<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="lib/jquery-3.2.1.js"></script>
    <style>
        *{
            margin:0;
            padding: 0;
        }
        .current{
            color: goldenrod;
        }
        .parent{
            margin-top: 30px;
            width: 200px;
            height: 200px;
            position: relative;
        }
        .account{
            width: 100%;
            height: 100%;
            position: absolute;
            background-color: hotpink;
            z-index: 100;
        }
        .saoma{
            width: 100%;
            height: 100%;
            position: absolute;
            background-color: deepskyblue;
        }

    </style>
</head>
<body>
    <ul>
        <li class="current">账号登录</li>
        <li>扫码登录</li>
    </ul>
    <div class="parent">
        <div class="account">账号登录</div>
        <div class="saoma">扫码登录</div>
    </div>
    <script>
        $("ul li").click(function(){
            $(this).addClass("current").siblings().removeClass("current")
            $(".parent div").eq($(this).index()).show().siblings().hide()
        })
    </script>
</body>
</html>